<%--
  Created by IntelliJ IDEA.
  User: WeaponLin
  Date: 2015/11/23
  Time: 14:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/table.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/app.css"/>

    <div id="menubar">
        <img src="<%=path%>/images/left.png" style="margin-top:auto;margin-bottom:auto;width:15px; height:15px">借阅图书
    </div>

    <s:if test="#session.loginState == 1 && #session.isAdmin == true">
        <table class="default" width="45%" style="margin-top:20px;margin-left: 20px">
            <col width="10%">
            <col width="15%">
            <col width="10%">
            <col width="5%">
            <col width="5%">
            <tr class="title">
                <td style="text-align:center">图书编号</td>
                <td style="text-align:center">书名</td>
                <td style="text-align:center">作者</td>
                <td style="text-align:center">出借数量</td>
                <td style="text-align:center">丢失数量</td>
            </tr>
            <s:if test="#session.borBook_list != null">
                <!-- 遍历开始 -->
                <s:iterator value="#session.borBook_list" var="borBook">
                    <tr class="list">
                        <td style="text-align:center"><a href="<%=path%>/admin/AdminAction_bookDetail.action?bookid=<s:property value="#borBook.bookid"
                            />&op=bor"><s:property value="#borBook.bookid"/></a></td>
                        <td style="text-align:center"><a href="<%=path%>/admin/AdminAction_bookDetail.action?bookid=<s:property value="#borBook.bookid"
                            />&op=bor"><s:property value="#borBook.bookname"/></a></td>
                        <td style="text-align:center"><s:property value="#borBook.author"/></td>
                        <td style="text-align:center"><s:property value="#borBook.quantityout"/></td>
                        <td style="text-align:center"><s:property value="#borBook.quantityloss"/></td>
                    </tr>
                </s:iterator>
            </s:if>
            <s:else>
                <table width="45%" style="margin-top:20px;margin-left: 20px">
                    <tr>
                        <td>
                            <h2  style="text-align: center">系统当前无借阅图书信息！</h2>
                        </td>
                    </tr>
                </table>
            </s:else>
        </table>
    </s:if>

    <s:else>
        <table width="100%" style="margin-top:50px;">
            <tr>
                <td>
                    <h2  style="text-align: center">请使用管理员账号登录！</h2>
                </td>
            </tr>
        </table>
    </s:else>
</html>


